package com.lx.idgenerator.autoconfigure;


import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * @author lX
 * @version JDK 8
 * @className SegmentRedisProperties (此处以class为例)
 * @date 2024/11/10
 * @description TODO
 */
@ConfigurationProperties(prefix = "id.generator.segment.storage.redis")
public class SegmentRedisProperties {


    private Long step;

    private RedisProperties master;

    private RedisProperties back;

    public RedisProperties getMaster() {
        return master;
    }

    public void setMaster(RedisProperties master) {
        this.master = master;
    }

    public RedisProperties getBack() {
        return back;
    }

    public void setBack(RedisProperties back) {
        this.back = back;
    }

    public Long getStep() {
        return step;
    }

    public void setStep(Long step) {
        this.step = step;
    }
}

class RedisProperties {

    private String mode = "";

    private String host = "localhost";

    private int port = 6379;

    private String password;

    private boolean ssl;

    /**
     * Connection timeout.
     */
    private Duration timeout;

    /**
     * Client name to be set on connections with CLIENT SETNAME.
     */
    private String clientName;

    private String url;


    private org.springframework.boot.autoconfigure.data.redis.RedisProperties.Jedis jedis = new org.springframework.boot.autoconfigure.data.redis.RedisProperties.Jedis();

    private org.springframework.boot.autoconfigure.data.redis.RedisProperties.Cluster cluster =new org.springframework.boot.autoconfigure.data.redis.RedisProperties.Cluster();

    private org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce lettuce = new org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce();

    private int database = 0;

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public org.springframework.boot.autoconfigure.data.redis.RedisProperties.Jedis getJedis() {
        return jedis;
    }

    public void setJedis(org.springframework.boot.autoconfigure.data.redis.RedisProperties.Jedis jedis) {
        this.jedis = jedis;
    }

    public org.springframework.boot.autoconfigure.data.redis.RedisProperties.Cluster getCluster() {
        return cluster;
    }

    public void setCluster(org.springframework.boot.autoconfigure.data.redis.RedisProperties.Cluster cluster) {
        this.cluster = cluster;
    }

    public boolean isSsl() {
        return ssl;
    }

    public void setSsl(boolean ssl) {
        this.ssl = ssl;
    }

    public Duration getTimeout() {
        return timeout;
    }

    public void setTimeout(Duration timeout) {
        this.timeout = timeout;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    public org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce getLettuce() {
        return lettuce;
    }

    public void setLettuce(org.springframework.boot.autoconfigure.data.redis.RedisProperties.Lettuce lettuce) {
        this.lettuce = lettuce;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getDatabase() {
        return database;
    }

    public void setDatabase(int database) {
        this.database = database;
    }
}








